package com.lsc.www.day09.hm;

public class s6 {

    public static void main(String[] args) {
        result(2021, 11, 22);
    }

    private static void result(int year, int month, int day) {
        int data = 30 * (month - 1) + day;
        if (month >= 11) {
            data = data + 6 - 2;
        } else if (month >= 9) {
            data = data + 5 - 2;
        } else if (month >= 8) {
            data = data + 4 - 2;
        } else if (month >= 6) {
            data = data + 3 - 2;
        } else if (month >= 4) {
            data = data + 2 - 2;
        } else if (month == 3) {
            data = data + 1 - 2;
        } else if (month == 2) {
            data = data + 1;
        }

        if (year % 4 == 0 && year % 100 != 0) {
            if (month > 2) {
                data++;
            }
            System.out.print(year + "年" + month + "月" + day + "日\t是" + year + "年" + "第" + data + "天");
        } else {
            System.out.print(year + "年" + month + "月" + day + "日\t是" + year + "年" + "第" + data + "天");
        }
    }
}

